<template>
  <div class="commodity-detail-item">
    <img
      :src="info.prize.poster"
      alt=""
    >
    <div class="detail-box">
      <div class="detail">
        <span>{{info.prize.name}}</span>
        <span>￥{{info.prize.price/100}}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { Cell, Tag } from "vant";
export default {
  name: "CommodityDetailItem",
  components: {
    [Cell.name]: Cell,
    [Tag.name]: Tag,
  },
  props: {
    isLink: {
      type: Boolean,
      default: false,
    },
    showBottomImg: {
      type: Boolean,
      default: false,
    },
    showEdmit: {
      type: Boolean,
      default: false,
    },
    prizeInfo: {
      type: Object,
      default: {},
    },
  },
  watch: {
    prizeInfo: {
      deep: true,
      immediate:true,
      handler: function (newVal) {
        this.info = newVal;
      },
    },
  },
  data() {
    return {
      info: {},
    };
  },
  created() {
    this.info = this.prizeInfo;
  },
  methods: {},
};
</script>

<style scoped lang="less">
.commodity-detail-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  width: 100%;
  height: 206px;
  img {
    width: 188px;
    height: 188px;
    border-radius: 20px;
    border: 4px solid #ffffff;
    overflow: hidden;
    position: absolute;
    left: 54px;
    top: -18px;
  }
  .detail-box {
    width: 100%;
    height: 172px;
    background: #dbdfff;
    border-radius: 88px;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
  }
  .detail {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: calc(100% - 268px);
    padding: 16px 0 18px 0;
    box-sizing: border-box;
    padding-right: 90px;
    box-sizing: border-box;
    span:first-child {
      font-size: 26px;
      color: #222222;
      line-height: 36px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }
    span:nth-child(2) {
      font-size: 28px;
      color: #d23c65;
      line-height: 32px;
    }
  }
}
</style>
